package com.im.chat.global;//package com.aorun.ymgh.controller.global;
//
//import com.aorun.ymgh.util.jsonp.Jsonp;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseBody;
//
///**
// * controller 增强器
// *
// * @author sam
// * @since 2017/7/17
// */
//@ControllerAdvice
//public class MyControllerAdvice {
//
//    /**
//     * 全局异常捕捉处理
//     * @param ex
//     * @return
//     */
//    @ResponseBody
//    @ExceptionHandler(value = Exception.class)
//    public Jsonp errorHandler(Exception ex) {
//        return Jsonp.error(ex.getCause().getMessage());
//    }
//
//
////    /**
////     * 全局异常捕捉处理
////     * @param ex
////     * @return
////     */
////    @ResponseBody
////    @ExceptionHandler(value = Exception.class)
////    public Map errorHandler(Exception ex) {
////        Map map = new HashMap();
////        map.put("code", 100);
////        map.put("msg", ex.getMessage());
////        return map;
////    }
//
//
////    /**
////     * 拦截捕捉自定义异常 MyException.class
////     * @param ex
////     * @return
////     */
////    @ResponseBody
////    @ExceptionHandler(value = MyException.class)
////    public Map myErrorHandler(MyException ex) {
////        Map map = new HashMap();
////        map.put("code", ex.getCode());
////        map.put("msg", ex.getMsg());
////        return map;
////    }
//
//
//}
